package practice11;

public class Student extends Person{
    private Klass klass;
    private String string;

    public Student(int id, String name, int age) {
        super(id, name, age);
    }

    public Student(int id, String name, int age, Klass klass) {
        super(id, name, age);
        this.klass = klass;
    }

    public Klass getKlass() {
        return klass;
    }

    public void setKlass(Klass klass) {
        this.klass = klass;
    }

    public String getString() {
        return string;
    }

    public void setString(String string) {
        this.string = string;
    }

    public String introduce() {

        string =super.introduce()+" I am a Student. I am at Class "+getKlass().getNumber()+".";
        if (klass.getLeader()==this){
            string =super.introduce()+" I am a Student. I am Leader of Class "+getKlass().getNumber()+".";
        }
        return string;
    }
}
